#ifndef _COMMON_H_
#define _COMMON_H_

#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>

typedef unsigned char U8;

// 定义最大section数量
#define MAX_SECTIONS 100

typedef struct BaseInfo {
    int port;
    int ld;
    int level;
} BaseInfo_t;

typedef struct {
    char key1[64];
    int  key2;
} Section1Data;

typedef struct {
    char key4[64];
    char key5[64];
    int  key6;
} Section2Data;

typedef struct {
    int a;
    int b;
    int c;
} Section3Data;

// cxl接口中公用的两个参数 :baseInfo和通过devName获取的ep
extern BaseInfo_t cxlBaseInfo;
extern char devName[2048];

int parse_hex_string(const char *hex_string, void *data, size_t size);
int getEp(char *devName);
void fillBaseInfo(const char* name, const char* value);

int func1(int a, BaseInfo_t *bt, Section1Data *section1Data);
int func2(int a, BaseInfo_t *bt, Section2Data *section2Data);
int func3(int a, BaseInfo_t *bt, Section3Data *section3Data);


#endif